package router

import (
	"family/api"
	"github.com/gin-gonic/gin"
)

// Router 路由管理
func Router(e *gin.Engine) {
	{
		people := e.Group("people")
		people.POST("create", api.PeopleAPI.Create)
		people.GET("details/:ID", api.PeopleAPI.Details)
		people.GET("page", api.PeopleAPI.Page)
		people.POST("update", api.PeopleAPI.Update)
		people.POST("delete", api.PeopleAPI.Delete)
		people.GET("tree", api.PeopleAPI.Tree)
	}

	{
		event := e.Group("event")
		event.POST("create", api.EventAPI.Create)
		event.GET("details/:ID", api.EventAPI.Details)
		event.GET("page", api.EventAPI.Page)
		event.POST("update", api.EventAPI.Update)
		event.POST("delete", api.EventAPI.Delete)
	}

	{
		spouse := e.Group("spouse")
		spouse.POST("create", api.SpouseAPI.Create)
		spouse.GET("details/:ID", api.SpouseAPI.Details)
		spouse.GET("page", api.SpouseAPI.Page)
		spouse.POST("update", api.SpouseAPI.Update)
		spouse.POST("delete", api.SpouseAPI.Delete)
	}
}
